import React from 'react'
import { Navigate } from 'react-router-dom'
function Index(Cpn) {
    return function () {
        let token = localStorage.getItem('token')
        if(token)
        {
            return <Cpn></Cpn>
        }
        else
        {
            return <Navigate to='/login'></Navigate>
        }
  }
}

export default Index
